#pragma once

#include "stdafx.h"
#include <vector>
#include "InputMesh.h"


using namespace std;
/**
* A base class for the 2 different cooking methods in 
* this application.
* @author Koen Samyn
*/
class Cooker
{
public:
	/**
	* Creates a new Cooker object with a filename.
	* @param inputFile the obj file with the physics mesh.
	* @param outputfile the file to send the cooked object to.
	*/
	Cooker(tstring inputFile,tstring outputfile);
	/**
	* Destroys the Cooker object.
	*/
	virtual ~Cooker(void);
	/**
	* Starts the cooking process. The input file will be read.
	* @return true if cooking the mesh was succesful, false otherwise.
	*/
	bool StartCooking();
	/**
	* This function cooks the triangle mesh. Subclass of this class
	* must implement the cooking process here.
	* A convex triangle mesh will be cooked differently then a
	* concave triangle mesh.
	* @return true if cooking was succesful, false otherwise.
	*/
	virtual bool Cook()=0;
	/**
	* Reads the input file and returns true
	* if reading the file was succesful. Only the vertex and triangle
	* data will be read, we don't need the material, skeleton and physics declarations.
	* @return true if the input file could be read, false otherwise.
	*/
	bool ReadInputFile();
	/**
	* Returns the beginning of the mesh vector.
	* @return the begin of the mesh vector.
	*/
	MIT InputMeshBegin() const {return m_Meshes.begin();}
	/**
	* Returns the end of the mesh vector.
	* @returns the end of the mesh vector.
	*/
	MIT InputMeshEnd() const{return m_Meshes.end();}
	/**
	* Returns the location for the outputfile.
	* @return the output file location.
	*/
	tstring GetOutputFile(){
		return m_OutputFile;
	}
protected:
	/**
	* The input file for this cooking process.
	*/
	tstring m_InputFile;
	/**
	* The output file for this cooking process.
	*/
	tstring m_OutputFile;
	/**
	* The vector of read mesh objects.
	*/
	vector<InputMesh*> m_Meshes;
private:
	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	Cooker(const Cooker& t);
	Cooker& operator=(const Cooker& t);
};
